<template>
	<view class="content">
		<view class="content_top">
			<image class="background-image" src="../../static/img/bg.png"></image>
			<view class="content_top_box">
				<view class="content_top_box_left">

					<view class="content_top_box_left_name">
						{{name}}
					</view>
				</view>
				<view class="content_top_box_right">

					<tn-avatar size="xl" :src="RLZP_FJ"></tn-avatar>
				</view>
			</view>
		</view>
		<view class="content_bottom">
			<view class="content_bottom_success">
				<view class="content_bottom_success_icon">
					<image src="../../static/img/saoerror.png" mode="widthFix" style="width: 420rpx;"></image>
				</view>
				<view class="content_bottom_success_title">
					<view class="content_bottom_success_title_img">
						<image src="../../static/img/error.png" mode="widthFix" style="width: 56rpx;    vertical-align: middle;
    margin-top: 8rpx;"></image>
					</view>
					<view class="content_bottom_success_title_det">
						你的位置超出了限定距离
					</view>
				</view>
			</view>
			<view class="content_bottom_list">
				<view class="content_bottom_list_btn" @click="toindex()">
					<span>重新扫码</span>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		BASE_URL
	} from '../../utils/request.js'
	export default {
		data() {
			return {
				name: '',
				RLZP_FJ: '',
			}
		},
		onLoad(optinos) {

			uni.getSystemInfo({
				success: (info) => {
					if (info.screenHeight <= 667) { // 假设iPhone X的高度是812像素
						this.dynamicHeight = 'calc(100% + 200rpx)'; // 如果设备高度小于iPhone X，则添加额外的200rpx
					}else{
							this.dynamicHeight = 'calc(100% - 200rpx)';
					}
				},
			});
			this.name = uni.getStorageSync('USER_NAME');
			this.RLZP_FJ = BASE_URL + '/portal/r' + uni.getStorageSync('lwphoto').slice(1);

		},
		methods: {
			toindex() {
				uni.switchTab({
					url: '../../pages/index/index'
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		width: 100%;
		height: 100vh;
		/* 占据整个视口高度 */
		display: flex;
		flex-direction: column;
		position: relative;
		/* 相对定位，以便子元素可以相对于它定位 */
	}

	.content_top {

		position: relative;
		/* 设置相对定位，以便子元素可以相对于它定位 */
		width: 100%;
		/* 宽度百分之百 */
		height: 500rpx;
		/* 设置高度 */
		overflow: hidden;

		/* 触发 BFC */
		.background-image {
			position: absolute;
			/* 设置绝对定位，让背景图充满整个父容器 */
			top: 0;
			left: 0;
			width: 100%;
			/* 宽度百分之百 */
			height: 100%;
			/* 高度百分之百 */
			object-fit: cover;
			/* 图片填充父容器 */
			z-index: -1;
			/* 将背景图放到底层 */
		}

		.content_top_box {
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin: 33rpx 73rpx 0 73rpx;

			.content_top_box_left {
				font-family: PingFang SC;
				font-weight: bold;
				font-size: 48rpx;
				color: #FFFFFF;
			}

			.content_top_box_right {}
		}
	}

	.content_bottom {
		flex: 1;
		/* 自动填充剩余空间 */
		position: absolute;
		/* 绝对定位，覆盖在 .content_top 上方 */
		top: 200rpx;
		/* 位于父容器顶部下方 200rpx 处 */
		width: 100%;
		/* 宽度百分之百 */
		height: calc(100% - 200rpx);
		/* 高度占满父容器下方 */
		background-color: #F8F9FD;
		/* 背景色，可根据需要修改 */
		z-index: 0;
		border-top-left-radius: 50rpx;
		border-top-right-radius: 50rpx;

		/* 确保在 content_top 之下 */
		// display: flex;
		// justify-content: center;
		// align-items: center;
		.content_bottom_success {
			margin-top: 240rpx;
			text-align: center;
		}

		.content_bottom_success_title {
			display: flex;
			justify-content: center;
			/* text-align: center; */
			align-items: center;
			margin-top: 88rpx;

			.content_bottom_success_title_det {
				font-family: PingFang SC;
				font-weight: 500;
				font-size: 48rpx;
				color: #FF2D2D;
				margin-left: 26rpx;
			}
		}

		.content_bottom_list {
			position: absolute;
			bottom: 83rpx;
			left: 5%;

			.content_bottom_list_btn {
				text-align: center;

				span {
					font-family: PingFang SC;
					font-weight: bold;
					font-size: 40rpx;
					color: #FFFFFF;
					background: linear-gradient(90deg, #3A84FD 0%, #536AFF 100%);
					border-radius: 20rpx;
					padding: 25rpx 262rpx;
				}
			}
		}




	}
</style>